package org.kailu.book.entity;
// default package
// Generated May 24, 2014 1:38:24 PM by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

/**
 * Author generated by hbm2java
 */

@Entity
@Proxy(lazy=false)
@Table(name = "author", catalog = "book")
public class AuthorEntity implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer authorId;
	private String authorName;
	private String authorAddress;
	private Set<BookEntity> books = new HashSet<BookEntity>(0);

	public AuthorEntity() {
	}

	public AuthorEntity(String authorName, String authorAddress) {
		this.authorName = authorName;
		this.authorAddress = authorAddress;
	}

	public AuthorEntity(String authorName, String authorAddress, Set<BookEntity> books) {
		this.authorName = authorName;
		this.authorAddress = authorAddress;
		this.books = books;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "author_id", unique = true, nullable = false)
	public Integer getAuthorId() {
		return this.authorId;
	}

	public void setAuthorId(Integer authorId) {
		this.authorId = authorId;
	}

	@Column(name = "author_name", nullable = false, length = 50)
	public String getAuthorName() {
		return this.authorName;
	}

	public void setAuthorName(String authorName) {
		this.authorName = authorName;
	}

	@Column(name = "author_address", nullable = false, length = 50)
	public String getAuthorAddress() {
		return this.authorAddress;
	}

	public void setAuthorAddress(String authorAddress) {
		this.authorAddress = authorAddress;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "author")
	public Set<BookEntity> getBooks() {
		return this.books;
	}

	public void setBooks(Set<BookEntity> books) {
		this.books = books;
	}

}
